package com.itheima.mapper;

import com.itheima.entity.Comment;
import com.itheima.vo.CommentVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper {

    @Select("select * from tb_comment where movies_id = #{movieId} order by time desc")
    List<Comment> findListByMovieId(Integer movieId);

    void save(Comment comment);

    List<CommentVO> findList(String creatorName, String moviesTitle);

    @Delete("delete from tb_comment where id = #{id}")
    void deleteById(Integer id);

    void deleteBatch(Integer[] ids);

    void deleteBatchByMoviesIds(Integer[] ids);
}